package net.cyndeline.components.world

import net.cyndeline.entitySystem.Component
import net.cyndeline.entitySystem.EntityRef

/**
 * Contains the information needed for an object to exist on a location
 * on a map.
 * 
 * This component should never be modified. Adjust an entitys position by
 * giving it a new position component.
 */
trait PositionComponent extends Component {
  def x: Int
  def x_=(n: Int)
  def y: Int
  def y_=(n: Int)
}

class Position extends PositionComponent {
  var x = 0
  var y = 0
  
  override def copy = {
    val copy = new Position()
    copy.x = x
    copy.y = y
    copy
  }
}